home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
c_lib.arc
/
FLSETATR.C
< prev
next >
Wrap
Text File
|
1990-08-09
|
1KB
|
56 lines
/**
*
* Name flsetatr -- Set file attributes
*
* Synopsis ercode = flsetatr(pfile,attrib);
* int ercode Returned DOS function error code
* char *pfile File path name
* int attrib File attribute
*
* Description This function sets the file attribute of the specified
* file. See FLCREATE for the possible attributes. Note
* that the attribute of subdirectories may not be reset.
*
* Returns ercode DOS 2.0 function return error code
*
* Version 1.1 (C)Copyright Blaise Computing Inc. 1983, 1984
*
**/
#include <compiler.h>
struct dreg
{
unsigned ax,bx,cx,dx,si,di,ds,es;
};
#define DOSREG struct dreg
int flsetatr(pfile,attrib)
char *pfile;
int attrib;
{
DOSREG dos_reg;
int utinit(),dos();
#if CI201A & LDATA
unsigned long ptrtoabs();
#endif
utinit(&dos_reg); /* Initialize registers */
dos_reg.ax = 0x4301; /* Function 43, set attribute */
dos_reg.cx = (unsigned)attrib;
#if LDATA
#if CI201A
dos_reg.ds = (unsigned)((ptrtoabs(pfile) & 0xffff0L) >> 4L);
dos_reg.dx = (unsigned)(ptrtoabs(pfile) & 0xfL);
#else
dos_reg.ds = (unsigned)(((long)(pfile) & 0xffff0L) >> 4L);
dos_reg.dx = (unsigned)((long)(pfile) & 0xfL);
#endif
#else
dos_reg.dx = (unsigned)pfile;
#endif
return(dos(&dos_reg));
}